<!DOCTYPE html>
<script src="https://lib.sinaapp.com/js/jquery/2.0.2/jquery-2.0.2.min.js"></script>

<div>
	<div>
		<label for="">用户名</label>
		<input type="text" name="username" >
	</div>
	<div>
		<label for="">密码</label>
		<input type="password" name="pwd">
	</div>
	<div>
		<label for="">性别</label>
		<input type="text" name="sex">
	</div>
	<div>
		<label for="">年龄</label>
		<input type="text" name="age">
	</div>
	<div>
		<label for="">出生年月</label>
		<input type="date" name="birthday">
	</div>
	<button onclick="save()">保存</button>
</div>

<script>
function save() {
	var regData = {}
	regData.username = $('input[name=username]').val();
	regData.pwd = $('input[name=pwd]').val();
	regData.sex = $('input[name=sex]').val();
	regData.age = $('input[name=age]').val();
	regData.birthday = $('input[name=birthday]').val();
	
	console.log('点击了保存按钮', regData)
}
</script>
